<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    $(function () {
        $("#contentTable").treeTable();
    })
</script>
<section class="panel">
    <div class="panel-body">
        <div class="panel-body">
            <div class="table-responsive no-border">
                <div class="datatable-top">
                    <div class="pull-left">
                        <form id="searchFormService"   method="post" class="form-inline">
                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                            <label>床号：</label><input name="bedNo" value="${patVisit.bedRec.bedNo}"  maxlength="50" class="form-control" />
                            <label>姓名：</label><input name="name" value="${patVisit.patVisitIndex.name}"  maxlength="50" class="form-control" />
                            <label>身份：</label><input name="identity" value="${fns:getDictLabels(patVisit.patVisitIndex.identity, 'PROFESSION_DICT', '')}"   maxlength="50" class="form-control" />
                            <label>费别：</label><input name="chargeType" value="${fns:getDictLabels(patVisit.patVisitIndex.chargeType, 'CHARGE_TYPE_DICT', '')}"    maxlength="50" class="form-control" />
                           <%-- &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>--%>
                        </form>
                    </div>
                </div>
                <table id="contentTable" class="table table-bordered mg-t datatable">
                    <thead>
                    <tr>
                        <th>处方日期</th>
                        <th>处方号</th>
                        <th>处方类型</th>
                        <th>计价</th>
                        <th>发药状态</th>
                        <th>发药时间</th>
                        <th>发药人</th>k
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${page.list}" var="presc" varStatus="status">
                        <tr id="${presc.id}">
                            <td><fmt:formatDate value="${presc.createDate}" pattern="yyyy-MM-dd  HH:mm:ss" /></td>
                            <td>${presc.applyOn}</td>
                            <td>${fns:getDictLabels(presc.itemClass, 'BILL_ITEM_CLASS_DICT', '')}</td>
                            <td>${presc.totalCosts}</td>
                            <td>${fns:getDictLabels(presc.confirmFlag, 'CONFIRM_DICT', '')}</td>
                            <td></td>
                            <td></td>
                        </tr>
                        <c:if test="${presc.prescriptionItems.size()>0}">
                            <tr id="${status.count}" pid="${presc.id}">
                                <td colspan="5">
                                    <table class="table table-bordered mg-t">
                                        <tr>
                                            <th>药品名称</th>
                                            <th>规格</th>
                                            <th>单位</th>
                                            <th>厂家</th>
                                            <th>单次剂量</th>
                                            <th>单位</th>
                                            <th>数量</th>
                                            <th>价格</th>
                                        </tr>
                                        <c:forEach items="${presc.prescriptionItems}" var="prescItems" varStatus="ss">
                                            <tr>
                                                <td>${prescItems.drugName}</td>
                                                <td>${prescItems.spec}</td>
                                                <td>${prescItems.firmId}</td>
                                                <td>${prescItems.singleDosage}</td>
                                                <td>${prescItems.unit}</td>
                                                <td>${prescItems.num}</td>
                                                <td>${prescItems.sumPrice}</td>
                                            </tr>
                                        </c:forEach>
                                    </table>
                                </td>
                            </tr>
                        </c:if>
                    </c:forEach>
                    </tbody>
                </table>
                <div class="pagination">${page}</div>
            </div>
        </div>
    </div>
</section>